Skip to content

Method: create(StateMatcher, InputMatcher)

1: package de.fhdw.wtf.dsl.scanner.common;
2:
3: import de.fhdw.wtf.common.token.Position;
4:
5: /**
6: * Reresents a loop in the {@link Scanner} automata. Where the current {@link ScannerState} object is also the next
7: * {@link ScannerState}.
8: *
9: * @see Delta
10: */
11: public class LoopDelta extends Delta {
12:         
13:         public LoopDelta(final StateMatcher fromStateMatcher, final InputMatcher inputMatcher) {
14:                 super(fromStateMatcher, inputMatcher);
15:         }
16:         
17:         @Override
18:         public ScannerState getNextScannerState(final Position position, final ScannerState currentState) {
19:                 return currentState;
20:         }
21:         
22:         /**
23:          * Factory-Method für {@link LoopDelta}.
24:          *
25:          * @param fromStateMatcher
26:          * : originalState
27:          * @param inputMatcher
28:          * @return new {@link LoopDelta}
29:          */
30:         public static LoopDelta create(final StateMatcher fromStateMatcher, final InputMatcher inputMatcher) {
31:                 return new LoopDelta(fromStateMatcher, inputMatcher);
32:         }
33:         
34: }